<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>add or update ztree</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<SCRIPT type=text/javascript src="<%=basePath%>js/jquery-1.7.1.min.js"></SCRIPT>
 
<script type="text/javascript" src="<%=basePath%>js/formly.min.js"></script>
<link rel="stylesheet" href="<%=basePath%>css/formly.min.css" type="text/css" />
<!-- 
	<link rel="stylesheet" href="<%=basePath%>css/jqtransformplugin/jqtransform.css" type="text/css" media="all" />
	<link rel="stylesheet" href="<%=basePath%>css/demo.jqtransform.css" type="text/css" media="all" />
	
	<script type="text/javascript" src="<%=basePath%>js/jquery.jqtransform.js" ></script>
-->
<style type="text/css">
	html, body,div,td {  
	   margin: 0;  
	    padding: 0;  
	    font-size:12px;  
	}  
</style>
<script type="text/javascript">

$(document).ready(function() { 
	$('#MyForm').formly(); 
});

function formSubmit(){
	
	$('#MyForm').submit();
	window.parent.frames["left"].location = "<%=basePath %>admin/menu.action";
	//document.parent.frames("left").location.reload(true);
}
</script>
 
</head>
  
  <body>
    <form action="admin/ztree!save.action" id="MyForm" title="菜单" method="post">
    	<s:hidden name="ztree.id"></s:hidden>
		<div>
			<table style="width: 100%;">
				<tr>
					<td style="width: 150px">名称：</td>
					<td>
						<s:textfield name="ztree.name" cssStyle="width: 200px" ></s:textfield>
					</td>
				</tr>
				<tr>
					<td style="width: 150px">显示位置：</td>
					<td><s:textfield name="ztree.target" value="mainFrame" cssStyle="width: 200px"></s:textfield>
					</td>
				</tr>
				<tr>
					<td style="width: 150px">是否父级菜单：</td>
					<td>
						&nbsp;&nbsp;<s:radio list="#{1:'是',0:'否'}" value="0" name="isPm"></s:radio>
					</td>
				</tr>
				<tr>
					<td style="width: 150px">链接：</td>
					<td>
						<s:textfield name="ztree.url" cssStyle="width: 400px" />
					</td>
				</tr>
				<tr>
					<td style="width: 150px">上级菜单ID：</td>
					<td><s:select list="gridModel" listKey="id" listValue="name" name="pid"></s:select>
					</td>
				</tr>
				<!-- 
				<tr>
					<td style="width: 150px">用户組別：</td>
					<td><s:select list="groupList" listKey="id" listValue="groupinfo" name="groupid"></s:select>
					</td>
				</tr>
				 -->
				<tr>
					<td align="center">
						<input type="button" style="cursor:pointer;" value="提交" onclick="formSubmit()"/>
						<input type="button" style="cursor:pointer;" value="返回" onclick="history.go(-1)">
					</td>
					<td>&nbsp;</td>
				</tr>
			</table>
		</div>
	
    </form>
  </body>
</html>
